<?php
/**
 * User: yuesir
 * Date: 2016/4/29
 * Time: 21:11
 */

namespace Lib;


class Proxy implements IUserProxy{
    function getUserName($id) {
        $db = Factory::getDatabase('slave');
        $db->query('SELECT `name` from user where id = '.$id);
    }

    function setUserName($id, $name) {
        $db = Factory::getDatabase('master');
        $db->query('UPDATE user set `name`='.$name . ' WHERE id='.$id);
    }
}